#ifndef _Function_Init_H_
#define _Function_Init_H_

#include "SC92F725x_C.H"
#include "intrins.H"
#define uchar unsigned char
#define uint unsigned int
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
#define IapROM 0x00    
#define IapEPPROM 0x02 
#define short_threshold 5
#define long_threshold 190
#define length 5
sbit test=P2^0;//检测水
sbit key=P2^1 ;//按键
sbit workled=P2^7 ;//工作led
sbit errled=P1^2 ;//缺水停机led
//**********标志位定义
extern uchar btmflag;
extern volatile uchar work_status;//0 stand-by  1 work 
extern  volatile uchar key_status; //0 testing&none  1 short 2 long
extern bit AdcFlag;
enum Channel {AIN0=0,AIN1,AIN6=6,AIN7,VDD4=15};
extern uchar UART_Data[];



//*************function 
extern void IO_Init(void);
extern void BTM_Init(void);
// extern void EXTI_Test(void);
extern uchar key_scan(void);
//extern void Timer_Test(void);
// extern void LCD_Test(void);
extern void PWM_Init(void);
extern void Uart0_Test(void);
extern void ADC_Init(uint Channel);
unsigned int ADC_AverageValue(void);
extern void PWM_on(void);
extern void PWM_off(void);
extern void Uart0_Init(void);
//extern void Delay100us(void);
#endif